package com.sqx.modules.app.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.entity.UserMoney;
import com.sqx.modules.app.entity.UserMoneyDetails;
import com.sqx.modules.orders.entity.Orders;
import com.sqx.modules.pay.entity.PayDetails;
import org.springframework.web.bind.annotation.RequestAttribute;

import java.math.BigDecimal;
import java.util.HashMap;

public interface UserMoneyService extends IService<UserMoney> {

    UserMoney selectUserMoneyByUserId(Long userId);

    void updateMoney(int i, Long userId, BigDecimal money);

    Double selectMyProfit(Long userId);

    Result payTakingOrder(Long userId, Long orderId);

    Result setMember(Orders orders, Long userId);

    PageUtils balanceDetailed(@RequestAttribute Long userId, Page<UserMoneyDetails> ipage);

    Result profitDetailed(@RequestAttribute Long userId, IPage ipage);

    int updateSafetyMoney(Integer type, Long userId, BigDecimal money);

    void safetyMoneyCallback(PayDetails payDetails);

    Result refundSafetMoney(Long userId);

    IPage<UserMoneyDetails> getBondDetails(Long userId, Integer page, Integer limit, UserMoneyDetails userMoneyDetails);

    HashMap<String ,Object> getSafetyMoneyData(Integer flag, String time);
}
